package com.bestcem.xm.deliver.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bestcem.xm.component.mybatis.base.BaseEntity2;
import com.bestcem.xm.deliver.config.StringValue2FastJsonSerializer;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @TableName ds_deliver_emaildeliver
 */
@TableName(value = "ds_deliver_emaildeliver")
@Data
@EqualsAndHashCode(callSuper = true)
public class DeliverEmailDeliver extends BaseEntity2 {
    @TableId(value = "id")
    private String id;

    /**
     * 组织ID
     */
    @TableField(value = "org_id")
    @JsonProperty("org_id")
    @JSONField(name = "org_id")
    private String orgId;

    /**
     * 问卷ID
     */
    @TableField(value = "survey_id")
    @JsonProperty("survey_id")
    @JSONField(name = "survey_id")
    private String surveyId;

    /**
     * 投放ID
     */
    @TableField(value = "deliver_id")
    @JsonProperty("deliver_id")
    @JSONField(name = "deliver_id")
    private String deliverId;

    /**
     * 投放组ID
     */
    @TableField(value = "deliver_group_id")
    @JsonProperty("deliver_group_id")
    @JSONField(name = "deliver_group_id")
    private String deliverGroupId;

    /**
     * 上传名单投放的email
     */
    @TableField(value = "email_list")
    @JsonProperty("email_list")
    @JSONField(name = "email_list", serializeUsing = StringValue2FastJsonSerializer.class)
    private String emailList;

    /**
     * 发送邮件邮箱
     */
    @TableField(value = "smtp_id")
    @JsonProperty("smtp_id")
    @JSONField(name = "smtp_id")
    private String smtpId;

    /**
     * 发送人
     */
    @TableField(value = "mail_from")
    @JsonProperty("mail_from")
    @JSONField(name = "mail_from")
    private String mailFrom;

    /**
     * 邮件主题
     */
    @TableField(value = "email_subject")
    @JsonProperty("email_subject")
    @JSONField(name = "email_subject")
    private String emailSubject;

    /**
     * 邮件模板
     */
    @TableField(value = "email_template")
    @JsonProperty("email_template")
    @JSONField(name = "email_template")
    private String emailTemplate;

    /**
     * 邮件模板id
     */
    @TableField(value = "email_template_id")
    @JsonProperty("email_template_id")
    @JSONField(name = "email_template_id")
    private String emailTemplateId;

    /**
     * 限制提交次数
     */
    @TableField(value = "check_submit")
    @JsonProperty("check_submit")
    @JSONField(name = "check_submit")
    private Integer checkSubmit;

    /**
     * 唯一编号
     */
    @TableField(value = "hashcode")
    @JsonProperty("hashcode")
    @JSONField(name = "hashcode")
    private String hashcode;

    /**
     * 是否定时投放
     */
    @TableField(value = "is_delay")
    @JsonProperty("is_delay")
    @JSONField(name = "is_delay")
    private Integer isDelay;

    /**
     * 是否需要审核
     */
    @TableField(value = "is_check")
    @JsonProperty("is_check")
    @JSONField(name = "is_check")
    private Integer isCheck;

    /**
     * 投放时间
     */
    @TableField(value = "deliver_time")
    @JsonProperty("deliver_time")
    @JSONField(name = "deliver_time", format = "yyyy/MM/dd HH:mm:ss")
    private LocalDateTime deliverTime;

    /**
     * 防止打扰的时间列表
     */
    @TableField(value = "anti_distur_times")
    @JsonProperty("anti_distur_times")
    @JSONField(name = "anti_distur_times", serializeUsing = StringValue2FastJsonSerializer.class)
    private String antiDisturTimes;

    /**
     * 备用投放时间
     */
    @TableField(value = "option_deliver_time")
    @JsonProperty("option_deliver_time")
    @JSONField(name = "option_deliver_time", serializeUsing = StringValue2FastJsonSerializer.class)
    private String optionDeliverTime;

    /**
     * 投放联系人过滤规则
     */
    @TableField(value = "filter_params")
    @JsonProperty("filter_params")
    @JSONField(name = "filter_params", serializeUsing = StringValue2FastJsonSerializer.class)
    private String filterParams;

    /**
     * 免打扰联系人ID
     */
    @TableField(value = "no_disturb_member_id_list")
    @JsonProperty("no_disturb_member_id_list")
    @JSONField(name = "no_disturb_member_id_list", serializeUsing = StringValue2FastJsonSerializer.class)
    private String noDisturbMemberIdList;

    /**
     * 是否是上传名单投放
     */
    @TableField(value = "is_upload")
    @JsonProperty("is_upload")
    @JSONField(name = "is_upload")
    private Integer isUpload;

    /**
     * 上传名单是否同步至联系人
     */
    @TableField(value = "is_sync_mem")
    @JsonProperty("is_sync_mem")
    @JSONField(name = "is_sync_mem")
    private Integer isSyncMem;

    @TableField(exist = false)
    private List<String> memberIdlist;
}